PlatformBitmapLoader class¶
Defined in
Namespace: Splat
Assembly: Splat.Drawing.dll
Full name: Splat.PlatformBitmapLoader<T>
Modifiers: public
Summary¶
AOT-compatible platform bitmap loader for Android.
This version requires explicit drawable name-to-ID mapping and uses no reflection.
Applies to
net10.0-android36.0
Class hierarchy
classDiagram
class PlatformBitmapLoader~T~
class IBitmapLoader {
<>
}
IBitmapLoader <|.. PlatformBitmapLoader~T~
class IEnableLogger {
<>
}
IEnableLogger <|.. PlatformBitmapLoader~T~
Implements: IBitmapLoader, IEnableLogger
Examples¶
// In your MAUI application startup:
var loader = new PlatformBitmapLoader<MyApp.Resource.Drawable>(name => name switch
{
"icon" => Resource.Drawable.icon,
"logo" => Resource.Drawable.logo,
"splash" => Resource.Drawable.splash,
_ => 0
});
Locator.CurrentMutable.RegisterConstant<IBitmapLoader>(loader);
Constructors¶
| Name | Summary |
|---|---|
| .ctor | Initializes a new instance of the [PlatformBitmapLoader](# class. |
Properties¶
| Name | Summary |
|---|---|
| DrawableType | Gets the Resource.Drawable type this loader was associated with at compile time. |
Methods¶
| Name | Summary |
|---|---|
| Load | Loads a bitmap from a byte stream. |
| LoadFromResource | Loads from the application's resources (i.e. from bundle on Cocoa, from Pack URIs on Windows, etc). |
| Create | Creates an empty bitmap of the specified dimensions. |